import { getToken } from "@/utils/storage"
import { applyMiddleware, createStore } from "redux"
import { composeWithDevTools } from "redux-devtools-extension"
import thunk from "redux-thunk"
import reducer from "./reducers"

// 三个参数
// 1.reducer
// 2.可选对象 用于提供初始值
// 3.提供中间件
const store = createStore(reducer, { login: { token: getToken() } }, composeWithDevTools(applyMiddleware(thunk)))

export default store
